#ifndef OBJECT_AFFILIATE_H
#define OBJECT_AFFILIATE_H

#include "object_screen.h"

class ObjectAffiliate : public Object {
protected:
    ObjectScreen *parent_ = nullptr; // 对象屏幕
    glm::vec2 offset_ = glm::vec2(0); // 偏移量
    glm::vec2 size_ = glm::vec2(0); // 大小
    Anchor anchor_ = Anchor::CENTER;

public:
    void setOffsetByAnchor(Anchor anchor);

    ObjectScreen *getParent() const { return parent_; } // 获取父对象
    void setParent(ObjectScreen *parent) { parent_ = parent; } // 设置父对象
    glm::vec2 getOffset() const { return offset_; } // 获取偏移量
    void setOffset(const glm::vec2 &offset) { offset_ = offset; } // 设置偏移量
    glm::vec2 getSize() const { return size_; } // 获取大小
    void setSize(const glm::vec2 &size);

    void setScale(const float scale); // 设置缩放
    void setAnchor(const Anchor anchor) {
        anchor_ = anchor;
    }

    Anchor getAnchor() const { return anchor_; }
};

#endif // OBJECT_AFFILIATE_H
